From 07759b158a741107448016dd1c6d45b970137ce2 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 9 Oct 2020 22:38:08 +0100 Subject: [PATCH] a11y: Add method to extract desktop data We are going to need the desktop name and path to populate the parent property of AtSpiContexts associated to top level widgets. --- gtk/a11y/gtkatspiroot.c | 16 ++++++++++++++-- gtk/a11y/gtkatspirootprivate.h | 5 +++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/gtk/a11y/gtkatspiroot.c b/gtk/a11y/gtkatspiroot.c index acc98f12a2..d27d979f35 100644 --- a/gtk/a11y/gtkatspiroot.c +++ b/gtk/a11y/gtkatspiroot.c @@ -209,8 +209,7 @@ handle_accessible_method (GDBusConnection *connection, GDBusMethodInvocation *invocation, gpointer user_data) { - g_printerr ("[Accessible] Method '%s' on interface '%s' for object '%s' from '%s'\n", - method_name, interface_name, object_path, sender); + GtkAtSpiRoot *self = user_data; if (g_strcmp0 (method_name, "GetRole") == 0) g_dbus_method_invocation_return_value (invocation, g_variant_new ("(u)", ATSPI_ROLE_APPLICATION)); @@ -455,3 +454,16 @@ gtk_at_spi_root_get_cache (GtkAtSpiRoot *self) return self->cache; } + +void +gtk_at_spi_root_get_application (GtkAtSpiRoot *self, + const char **name, + const char **path) +{ + g_return_if_fail (GTK_IS_AT_SPI_ROOT (self)); + + if (name != NULL) + *name = self->desktop_name; + if (path != NULL) + *path = self->desktop_path; +} diff --git a/gtk/a11y/gtkatspirootprivate.h b/gtk/a11y/gtkatspirootprivate.h index 4e951bbcea..268c8a161f 100644 --- a/gtk/a11y/gtkatspirootprivate.h +++ b/gtk/a11y/gtkatspirootprivate.h @@ -39,4 +39,9 @@ gtk_at_spi_root_get_connection (GtkAtSpiRoot *self); GtkAtSpiCache * gtk_at_spi_root_get_cache (GtkAtSpiRoot *self); +void +gtk_at_spi_root_get_application (GtkAtSpiRoot *self, + const char **name, + const char **path); + G_END_DECLS -- 2.30.2